package sssta.org.picassodemo;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;


public class MainActivity extends ActionBarActivity {

    private RecyclerView recyclerView;
    private StudentAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        SharedPreferences sp = getSharedPreferences(Constants.SP_KEY, Context.MODE_PRIVATE);


        User user = User.getInstance();

        if(user.isLogin()){

        }


        recyclerView = (RecyclerView) findViewById(R.id.recycler);

        GridLayoutManager layoutManager = new GridLayoutManager(this,3);
        recyclerView.setLayoutManager(layoutManager);

        List<String> ids = new ArrayList<>();

        for (long id = 13130110001l; id < 13130110051l;id++){
            ids.add(String.valueOf(id));
        }


        mAdapter = new StudentAdapter(this,ids);
        recyclerView.setAdapter(mAdapter);
    }



}
